import React, {Component} from 'react';
import Header from '../layout/header';
import {CommonContainer} from "../layout/container"
import Footer from "../layout/footer";
import VideoList from "../layout/video";
import Leftbar from "../layout/leftbar";
import {Button} from "antd";
import loginStore from "../../store/login"
import "../css/login.css"
import "../../static/icons/close/iconfont.css"
// import MdPreview from "../layout/md-preview";



class Login extends Component {
    constructor(props) {
        super(props);
        this.state = {
            PageDisplay:{display:"none"}
        }
    }
    componentDidMount() {
        loginStore.subscribe(()=>{
            this.setState(loginStore.getState())
        });
    }

    onClickHandle(){
        this.setState({   PageDisplay:{display:"none"}})
    }

    render() {
        console.log("-----------------",this.state.PageDisplay)
        return (
            <div className="login_container" style={{display:this.state.PageDisplay.display}}>
                <div className="login_div">
                    <div className="login_page">
                        <div className="login_top"><span className="login_name">登录</span> <span className="icon iconfont icon-guanbi" onClick={this.onClickHandle.bind(this)}></span></div>
                        <div className="login_center">
                            <div>
                                <input type="text" placeholder="请输入用户名" name="uname"/>
                            </div>
                            <div>
                                <input type="password" placeholder="请输入密码" name="upass"/>
                            </div>
                            <div>
                                <button className="login_button">登录</button>
                            </div>
                        </div>

                        
                        <div className="login_submit">
                            <span>忘记密码</span>
                            <span>注册</span>
                        </div>
                    </div>

                </div>
            </div>

        )

    }}

export default Login;
